package fox.framework.rpc.endpoint.exchange;

import fox.framework.rpc.client.message.response.RpcClientResponse;
import fox.framework.rpc.exception.RpcRequestTimeOutException;
import fox.framework.rpc.exception.RpcRequestUndoException;

import java.util.concurrent.TimeUnit;

/**
 * @author cuichao
 * @Description: Future
 * @Date: create in 2021/1/23 22:12
 */
public interface Future {

    RpcClientResponse get() throws RpcRequestUndoException;

    RpcClientResponse get(long time, TimeUnit unit) throws InterruptedException,RpcRequestUndoException, RpcRequestTimeOutException;

    void undo(Throwable undoCause);


}
